<!DOCTYPE html>
<head>
	<meta charset="UTF-8">
	<title></title>
</head>
<body>
	 
	第一个数:<input type="text" id="ly"/> </br>
	第二个数:<input type="text" id="lyy"/></br>
	操作: &nbsp;&nbsp;&nbsp;<input type="button" value="加" onclick="aa('+')"/>
		    <input type="button" value="减" onclick="aa('-')"/> 
			 <input type="button" value="乘" onclick="aa('*')"/> 
			  <input type="button" value="除" onclick="aa('/')"/> </br>
	结果：<input type="text" id="jieguo"/> 
	<script>
		function aa(bb){
			var num1=Number(document.getElementById('ly').value);
			var num2=Number(document.getElementById('lyy').value);
			var s=jieguo;
			switch(bb){
				case'+':s=num1+num2;break;
				case'-':s=num1-num2;break;
				case'*':s=num1*num2;break;
				case'/':s=num1/num2;break;
			}
			document.getElementById('jieguo').value=s;
		}
	</script> 
	</body>
</html>
